package com.hongdee.insurance.quotation.dao.impl;

import com.hongdee.base.basedao.impl.BaseDaoImpl;
import com.hongdee.insurance.quotation.dao.ITInsuranceQuotationDao;
import com.hongdee.insurance.quotation.entity.TInsuranceQuotation;
import com.hongdee.insurance.quotation.entity.TInsuranceTask;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Mr. Xu on 2017/4/26.
 */
@Service
public class TInsuranceQuotationDaoImpl extends BaseDaoImpl implements ITInsuranceQuotationDao{
    @Override
    public TInsuranceQuotation getQuotationById(String id) throws Exception {
        String hql="from TInsuranceQuotation where id=:id";
        Map<String,Object> map=new HashMap<>();
        map.put("id",id);
        return (TInsuranceQuotation) this.getHibernateDao().findEntityByHqlWithParams(hql,map);
    }

    @Override
    public TInsuranceTask insuranceTaskInfo(String quotationId) throws Exception {
        String hql="from TInsuranceTask where quotationId=:quotationId";
        Map params=new HashMap();
        params.put("quotationId",quotationId);
        return (TInsuranceTask) this.getHibernateDao().findEntityByHqlWithParams(hql,params);
    }
}
